import request from '@/axios'
import { SystemGroupType } from './types'

//分页获取系统分组
export const pageApi = (data) => {
  return request.post({ url: '/rbac-server/rbac/systemgroup/page', data })
}
//新增系统分组
export const addApi = (data) => {
  return request.post({ url: '/rbac-server/rbac/systemgroup/add', data })
}
//获取系统分组
export const getApi = (params) => {
  return request.get({ url: '/rbac-server/rbac/systemgroup/get', params })
}
//删除系统分组
export const delApi = (params) => {
  return request.delete({ url: '/rbac-server/rbac/systemgroup/delete', params })
}
//修改系统分组
export const updateApi = (data) => {
  return request.put({ url: '/rbac-server/rbac/systemgroup/update', data })
}
//系统分组排序
export const sortApi = (params) => {
  return request.put({ url: '/rbac-server/rbac/systemgroup/sort', params })
}

//获取系统分组
export const listApi = (): Promise<IResponse<SystemGroupType[]>> => {
  return request.get({ url: '/rbac-server/rbac/systemgroup/list' })
}
